﻿using System;
using System.ComponentModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TestMatrix.Model
{
    public class tblBugList : INotifyPropertyChanged, INotifyPropertyChanging
    {

        public tblBugList()
        {
           
        }

        public tblBugList(
            int id
            , int itemID
            , string projectName
            , string assignedTo
            , string state
            , string severity
            , string foundInEnvironment
            , DateTime createdDate
            , DateTime resolvedDate
            , DateTime closedDate
            , string projectFriendName
            , string bugType
            , string createdBy
            , string resolvedBy
            , int count
            )
        {
            this.ID = id;
            this.ItemID = itemID;
            this.ProjectName = projectName;
            this.AssignedTo = assignedTo;
            this.State = state;
            this.Severity = severity;
            this.FoundInEnvironment = foundInEnvironment;
            this.CreatedDate = createdDate;
            this.ResolvedDate = resolvedDate;
            this.ClosedDate = closedDate;
            this.ProjectFriendName = projectFriendName;
            this.BugType = bugType;
            this.CreatedBy = createdBy;
            this.ResolvedBy = resolvedBy;
            this.Count = count;
        }

        private int _ID;

        public int ID
        {
            get { return _ID; }
            set
            {
                if (_ID != value)
                {
                    NotifyPropertyChanging("ID");
                    _ID = value;
                    NotifyPropertyChanged("ID");
                }
            }

        }

        private string _ProjectName;

        public string ProjectName
        {
            get { return _ProjectName; }
            set
            {
                if (_ProjectName != value)
                {
                    NotifyPropertyChanging("ProjectName");
                    _ProjectName = value;
                    NotifyPropertyChanged("ProjectName");
                }
            }

        }

        private int _ItemID;

        public int ItemID
        {
            get { return _ItemID; }
            set
            {
                if (_ItemID != value)
                {
                    NotifyPropertyChanging("ItemID");
                    _ItemID = value;
                    NotifyPropertyChanged("ItemID");
                }
            }

        }

        private string _AssignedTo;

        public string AssignedTo
        {
            get { return _AssignedTo; }
            set
            {
                if (_AssignedTo != value)
                {
                    NotifyPropertyChanging("AssignedTo");
                    _AssignedTo = value;
                    NotifyPropertyChanged("AssignedTo");
                }
            }

        }

        private string _State;

        public string State
        {
            get { return _State; }
            set
            {
                if (_State != value)
                {
                    NotifyPropertyChanging("State");
                    _State = value;
                    NotifyPropertyChanged("State");
                }
            }

        }

        private string _Severity;

        public string Severity
        {
            get { return _Severity; }
            set
            {
                if (_Severity != value)
                {
                    NotifyPropertyChanging("Severity");
                    _Severity = value;
                    NotifyPropertyChanged("Severity");
                }
            }

        }

        private string _Priority;

        public string Priority
        {
            get { return _Priority; }
            set
            {
                if (_Priority != value)
                {
                    NotifyPropertyChanging("Priority");
                    _Priority = value;
                    NotifyPropertyChanged("Priority");
                }
            }

        }

        private string _FoundInEnvironment;

        public string FoundInEnvironment
        {
            get { return _FoundInEnvironment; }
            set
            {
                if (_FoundInEnvironment != value)
                {
                    NotifyPropertyChanging("FoundInEnvironment");
                    _FoundInEnvironment = value;
                    NotifyPropertyChanged("FoundInEnvironment");
                }
            }

        }

        private DateTime _CreatedDate;

        public DateTime CreatedDate
        {
            get { return _CreatedDate; }
            set
            {
                if (_CreatedDate != value)
                {
                    NotifyPropertyChanging("CreatedDate");
                    _CreatedDate = value;
                    NotifyPropertyChanged("CreatedDate");
                }
            }

        }
        private DateTime _ResolvedDate;

        public DateTime ResolvedDate
        {
            get { return _ResolvedDate; }
            set
            {
                if (_ResolvedDate != value)
                {
                    NotifyPropertyChanging("ResolvedDate");
                    _ResolvedDate = value;
                    NotifyPropertyChanged("ResolvedDate");
                }
            }

        }

        private DateTime _ClosedDate;

        public DateTime ClosedDate
        {
            get { return _ClosedDate; }
            set
            {
                if (_ClosedDate != value)
                {
                    NotifyPropertyChanging("ClosedDate");
                    _ClosedDate = value;
                    NotifyPropertyChanged("ClosedDate");
                }
            }

        }

        private string _ProjectFriendName;

        public string ProjectFriendName
        {
            get { return _ProjectFriendName; }
            set
            {
                if (_ProjectFriendName != value)
                {
                    NotifyPropertyChanging("ProjectFriendName");
                    _ProjectFriendName = value;
                    NotifyPropertyChanged("ProjectFriendName");
                }
            }

        }

        private string _BugType;

        public string BugType
        {
            get { return _BugType; }
            set
            {
                if (_BugType != value)
                {
                    NotifyPropertyChanging("BugType");
                    _BugType = value;
                    NotifyPropertyChanged("BugType");
                }
            }

        }

        private string _CreatedBy;

        public string CreatedBy
        {
            get { return _CreatedBy; }
            set
            {
                if (_CreatedBy != value)
                {
                    NotifyPropertyChanging("CreatedBy");
                    _CreatedBy = value;
                    NotifyPropertyChanged("CreatedBy");
                }
            }

        }

        private string _ResolvedBy;

        public string ResolvedBy
        {
            get { return _ResolvedBy; }
            set
            {
                if (_ResolvedBy != value)
                {
                    NotifyPropertyChanging("ResolvedBy");
                    _ResolvedBy = value;
                    NotifyPropertyChanged("ResolvedBy");
                }
            }

        }

        private int _Count;

        public int Count
        {
            get { return _Count; }
            set
            {
                if (_Count != value)
                {
                    NotifyPropertyChanging("Count");
                    _Count = value;
                    NotifyPropertyChanged("Count");
                }
            }

        }


        public override string ToString()
        {
            return FoundInEnvironment + "  " + AssignedTo + "  " + State;
        }

        public event PropertyChangedEventHandler PropertyChanged;

        // Used to notify that a property changed
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;

        // Used to notify that a property is about to change
        private void NotifyPropertyChanging(string propertyName)
        {
            if (PropertyChanging != null)
            {
                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
            }

        }
    }
}
